<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj = {
            name: 'rose',
            age:20,
        }

        let newObj = {}
        //将旧对象obj拷贝给新对象newObj
        Object.assign(newObj,obj)
        console.log(newObj);
        console.log(newObj === obj);
        //展开运算符
        let newObj2 = {...obj}
        console.log(newObj2);
        console.log(newObj2 === obj);
        // 数组的concat()方法可以进行数组拼接
        const arr = [1,2,4]
        let newArr = []
        newArr = newArr.concat(arr)
        console.log(newArr);
        console.log(newArr === arr);
    </script>
</body>
</html>